import 'package:dio/dio.dart';

const leading = 'user';

Future<Response<dynamic>> register({
  required Map<String, dynamic> user,
  required Dio dio,
}) async {
  Response<dynamic> response = await dio.post('/$leading/register', data: user);
  return response;
}

Future<Response<dynamic>> login({
  required Map<String, dynamic> user,
  required Dio dio,
}) async {
  Response<dynamic> response = await dio.post('/$leading/login', data: user);
  return response;
}

Future<Response<dynamic>> updateUser({
  required Map<String, dynamic> user,
  required Dio dio,
}) async {
  Response<dynamic> response = await dio.post('/$leading/update', data: user);
  return response;
}

Future<Response<dynamic>> deleteUserById({
  required Map<String, dynamic> user,
  required Dio dio,
}) async {
  Response<dynamic> response = await dio.post('/$leading/delete', data: user);
  return response;
}

Future<Response<dynamic>> getAllUsers({
  required Dio dio,
}) async {
  Response<dynamic> response = await dio.post('/$leading/all');
  return response;
}
